url = 'https://www.acwing.com/problem/content/4811/'

n, k = input().split()
t = input()

i = 1
# 判断两边是否相等
while t[i:] != t[:-i]:
    i += 1
print(t[:i] * int(k) + t[i:])
